# -*- coding: utf-8 -*-

__author__ = 'Michael Liao'

# from models import StoreBook,StoreChapter
# import db

from framwork.models import StoreBook,StoreChapter
import framwork.db as db

db.create_engine(user='root', password='', database='bookstore')
u = StoreBook(bookname='ceshi',author='lankan')
u.insert()

print 'new user id:', u.id


# u1 = StoreBook.find_first('where bookname=?', 'ceshi')
# print 'find user\'s name:', u1.author

# u1 = User.find_first('where email=?', 'test@example.com')
# print 'find user\'s name:', u1.name
#
# u1.delete()
#
# u2 = User.find_first('where email=?', 'test@example.com')
# print 'find user:', u2
